package n11.first2;
import java.util.HashMap;
import java.util.Map;
public class Teacher {
	private static final Map<Integer, Integer>map;
	static { //静态代码块，用来对静态变量进行初始化
		map=new HashMap<>();
		String s= "181988022	8\n"
				+ "182005026	8\n"
				+ "182006021	9\n"
				+ "302018037	9";
				
		String[] hs = s.split("\n");
		for(String h:hs) {
			String[] item = h.split("\t");
			int jobNum = Integer.parseInt(item[0]);
			int orgId=Integer.parseInt(item[1]);
			map.put(jobNum, orgId);
		}
	}
	//(1)根据组织id获取部门信息
	//(2)根据教师的工号获取教师的部门组织信息
	public static String getOrganization(int id_Num) {
		Integer orgId = map.get(id_Num);//假设id_Num是工号
		if(orgId!=null)return Organization.getOrganization(orgId);//的确是工号
		return Organization.getOrganization(id_Num);//实际可能是orgId
	}
}
